var api = require('../../utils/api');
var utils = require('../../utils/utils');

Page({
    data: {
        orders: [], // 当前条件订单列表
    },
    onLoad: function (options) {
        var symbol = options.symbol;
        this.loadOrders(symbol);
    },
    loadOrders: function (symbol) {
        // console.log(this.data.pair);
        api.getOrders({
            symbol: symbol,
            states: 'filled,canceled,partial_canceled' //'submitted,partial_filled'
        }).then(orders => {
            this.setData({
                orders: utils.formatOrders(orders)
            });
        });
    },
})